from flask import Flask, request, render_template

app = Flask(__name__)

@app.route('/',methods=['GET','POST'])
def home():
    return render_template('hello.html')

@app.route('/signin',methods=['GET'])
def signin_from():
    return render_template('form.html')

@app.route('/signin',methods=['POST'])
def signin():
    if request.form['username'] == 'admin' and request.form['password'] == 'admin':
        return render_template('signin_ok.html')
    return render_template('form.html',message = '账号或者密码错误！',username = request.form['username'])

if __name__ == '__main__':
    app.run()